// directive.js （和main.js同级）
import Vue from 'vue'

// 滚动加载更多
Vue.directive('loadMore', {
  bind(el, binding) {
    // 获取element，定义scroll
    let select_dom = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap');
    select_dom.addEventListener('scroll', function () {
      let height = this.scrollHeight - Math.floor(this.scrollTop) - 1 <= this.clientHeight;
      if (height) {
        binding.value()
      }
    })
  }
})
